<?php

namespace App\Http\Controllers\Teaching;

use App\Common\Utils\JsonResponse;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;

class PaperController extends Controller
{
    /** @var \App\Services\System\LogService $logService */
    private $logService;
    /** @var \App\Services\Teaching\TeachingExportService $teachingExportService */
    private $teachingExportService;

    /**
    * Create a new controller instance.
    *
    * @return void
    */
    public function __construct()
    {
        parent::__construct();
        $this->middleware('auth');
        $this->logService = app('logService');
        $this->teachingExportService = app('teachingExportService');
    }

    /*
     * @Description: 论文发表导出
     * @Author:  Kzj
     * @Date: 2023-11-17 14:43:04
     */
    public function export(Request $request)
    {
        try{
            $result = $this->teachingExportService->exportPaper($request->all());
            $this->logService->log('341', '论文发表导出', '论文发表导出');
            return JsonResponse::success($result,'操作成功');
        }catch(\Exception $e){
            return JsonResponse::error($e->getMessage());
        }
    }
}
